package net.zzy.pbbot.plugin.zfbSign.tool;

import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhuZhaoYang
 * @date 2021/10/5 23:16
 */
@Component
public class ZfbUtil {

    public static Map<String, String> getSaveHeader(String schoolId) {
        Map<String, String> headers = new HashMap<>();
        headers.put("Host", "fxgl.jx.edu.cn");
        headers.put("Connection", "keep-alive");
        headers.put("Accept", "*/*");
        headers.put("Origin", "https://fxgl.jx.edu.cn");
        headers.put("X-Requested-With", "XMLHttpRequest");
        headers.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36");
        headers.put("Content-type", "application/x-www-form-urlencoded");
        headers.put("Referer", "https://fxgl.jx.edu.cn/" + schoolId + "/user/qdbp");
        return headers;
    }


    public static Map<String, String> getSaveForm(String province, String city, String district, String street, String lng, String lat) {

        Map<String, String> params = new HashMap<>();
        params.put("province", province);
        params.put("city", city);
        params.put("district", district);
        params.put("street", street);
        params.put("xszt", "0");
        params.put("jkzk", "0");
        params.put("jkzkxq", "");
        params.put("sfgl", "1");
        params.put("gldd", "");
        params.put("mqtw", "0");
        params.put("mqtwxq", "");
        params.put("zddlwz", province + city + district + street);
        params.put("sddlwz", "");
        params.put("bprovince", province);
        params.put("bcity", city);
        params.put("bdistrict", district);
        params.put("bstreet", street);
        params.put("sprovince", province);
        params.put("scity", city);
        params.put("sdistrict", district);
        params.put("lng", lng);
        params.put("lat", lat);
        params.put("sfby", "1");
        return params;
    }
}
